<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Constructs EventBufferEvent object</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="eventbufferevent.connecthost.html">EventBufferEvent::connectHost</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="eventbufferevent.createpair.html">EventBufferEvent::createPair</a></div>
 <div class="up"><a href="class.eventbufferevent.html">EventBufferEvent</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="eventbufferevent.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">EventBufferEvent::__construct</h1>
  <p class="verinfo">(PECL event &gt;= 1.2.6-beta)</p><p class="refpurpose"><span class="refname">EventBufferEvent::__construct</span> &mdash; <span class="dc-title">Constructs EventBufferEvent object</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-eventbufferevent.construct-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="methodname"><strong>EventBufferEvent::__construct</strong></span>
    ( <span class="methodparam">
    <span class="type"><a href="class.eventbase.html" class="type EventBase">EventBase</a></span>
     <code class="parameter">$base</code>
   </span>
   [, <span class="methodparam">
    <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span>
     <code class="parameter">$socket</code>
    <span class="initializer"> = <strong><code>NULL</code></strong></span>
   </span>
   [, <span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$options</code>
    <span class="initializer"> = 0</span>
   </span>
   [, <span class="methodparam">
    <span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span>
     <code class="parameter">$readcb</code>
    <span class="initializer"> = <strong><code>NULL</code></strong></span>
   </span>
   [, <span class="methodparam">
    <span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span>
     <code class="parameter">$writecb</code>
    <span class="initializer"> = <strong><code>NULL</code></strong></span>
   </span>
   [, <span class="methodparam">
    <span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span>
     <code class="parameter">$eventcb</code>
    <span class="initializer"> = <strong><code>NULL</code></strong></span>
   </span>
  ]]]]] )</div>

  <p class="para rdfs-comment">
   Create a buffer event on a socket, stream or a file descriptor. Passing
   <strong><code>NULL</code></strong> to
   <em><code class="parameter">socket</code></em>
   means that the socket should be created later, e.g. by means of
   <span class="methodname"><a href="eventbufferevent.connect.html" class="methodname">EventBufferEvent::connect()</a></span>
   .
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-eventbufferevent.construct-parameters">
  <h3 class="title">参数</h3>
  <dl>

   
    <dt>

     <em><code class="parameter">base</code></em>
    </dt>

    <dd>

     <p class="para">
      Event base that should be associated with the new buffer event.
     </p>
    </dd>

   
   
    <dt>

     <em><code class="parameter">socket</code></em>
    </dt>

    <dd>

     <p class="para">
      May be created as a stream(not necessarily by means of
      <em>sockets</em>
      extension)
     </p>
    </dd>

   
   
    <dt>

     <em><code class="parameter">options</code></em>
    </dt>

    <dd>

     <p class="para">
      One of
      <a href="class.eventbufferevent.html#eventbufferevent.constants" class="link">EventBufferEvent::OPT_*
     constants</a>
      , or
      <strong><code>0</code></strong>
      .
     </p>
    </dd>

   
   
    <dt>

     <em><code class="parameter">readcb</code></em>
    </dt>

    <dd>

     <p class="para">
      Read event callback. See
      <a href="eventbufferevent.about.callbacks.html" class="link">About buffer event
     callbacks</a>
      .
     </p>
    </dd>

   
   
    <dt>

     <em><code class="parameter">writecb</code></em>
    </dt>

    <dd>

     <p class="para">
      Write event callback. See
      <a href="eventbufferevent.about.callbacks.html" class="link">About buffer event
     callbacks</a>
      .
     </p>
    </dd>

   
   
    <dt>

     <em><code class="parameter">eventcb</code></em>
    </dt>

    <dd>

     <p class="para">
      Status-change event callback. See
      <a href="eventbufferevent.about.callbacks.html" class="link">About buffer event
     callbacks</a>
      .
     </p>
    </dd>

   
   
    <dt>

     <em><code class="parameter">arg</code></em>
    </dt>

    <dd>

     <p class="para">
      A variable that will be passed to all the callbacks.
     </p>
    </dd>

   
  </dl>

 </div>

 <div class="refsect1 returnvalues" id="refsect1-eventbufferevent.construct-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns buffer event resource optionally associated with socket resource.
   */
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-eventbufferevent.construct-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member">
    <span class="methodname"><a href="eventbufferevent.sslfilter.html" class="methodname" rel="rdfs-seeAlso">EventBufferEvent::sslFilter()</a> - Create a new SSL buffer event to send its data over another buffer event</span>
   </li>
   <li class="member">
    <span class="methodname"><a href="eventbufferevent.sslsocket.html" class="methodname" rel="rdfs-seeAlso">EventBufferEvent::sslSocket()</a> - Creates a new SSL buffer event to send its data over an SSL on a socket</span>
   </li>
  </ul>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="eventbufferevent.connecthost.html">EventBufferEvent::connectHost</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="eventbufferevent.createpair.html">EventBufferEvent::createPair</a></div>
 <div class="up"><a href="class.eventbufferevent.html">EventBufferEvent</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
